
public class Example4 {

	public static void main(String[] args) {
		int[] nums = {1,3,2,45,0,23};
		int[] newNums = myReverse2(nums);
		myPrintArray(newNums);
	}
	public static void myPrintArray(int[] ns) {
		for(int item:ns) {
			System.out.print(item+"\t");
		}
	}
	public static int[] myReverse(int[] ns) {
		int len = ns.length;
		int[] numArray = new int[len];
		for(int i=0;i<len;i++) {
			numArray[len-i-1] = ns[i];
		}
		return numArray;
	
	}
	public static int[] myReverse2(int[] ns) {
		int len = ns.length;
		int temp;
		for(int i=0;i<len/2;i++) {
			temp = ns[i];
			ns[i] = ns[len-i-1];
			ns[len-i-1]= temp;
		}
		return ns;
	
	}

}
